package com.adnaan.backend.mapper;

import com.adnaan.backend.entity.SysPermission;
import com.adnaan.backend.entity.SysUser;
import com.adnaan.backend.entity.dto.OptionDto;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.List;

public interface SysUserMapper extends BaseMapper<SysUser> {
    List<OptionDto> getRolesByUserId(@Param("userId") Long id);

    void insertRoleIds(@Param("userId") Long id, @Param("roleIds") List<String> roleIds);

    void deleteRoleIds(@Param("userId") Long id);

    List<String> getRoleCodeByUserId(@Param("userId") Long userId);

    List<String> listPermissionsByRoleCode(@Param("roleCode") String roleCode);

    List<SysPermission> listMenuByUserId(@Param("userId") long loginIdAsLong);

    Integer selectNewUserCountByDate(LocalDate date);

    void setLastLoginTime(Long id);
}
